-- element_altar
-- created by panyl
-- 地牢格子：元素圣坛

return {
    restoreGrid = function(grid, info)
        -- 还原状态
        grid.submit_state = info["submit_state"] or 0;
    end,

    collectContext = function(grid)
        -- 收集
        return { ["submit_state"] = grid.submit_state or 0, };
    end,

    autoFight = function(grid)
        -- 随机提交
        local index = math.random(#ELEM_LIST);
        local elem = ELEM_LIST[index];
        return DungeonActionM.go("submit_element", grid:getPos(), elem);
    end
};
